// createRouter:创建router实例对象
// createWebHistory:创建history实例对象
import {createRouter, createWebHistory} from 'vue-router'
import Login from '@/views/Login/index.vue';
import Layout from '@/views/Layout/index.vue';
import FirstMenu from '@/views/Layout/components/FirstMenu.vue';
import Home from '@/views/Home/Material/index.vue';
import Material from '@/views/Home/Material/index.vue';
import Equipment from '@/views/Home/Equipment/index.vue';
import EquipmentList from '@/views/Home/Equipment/components/equipment/equipmentList.vue';
import EquipmentDetail from '@/views/Home/Equipment/components/equipment/equipmentDetail.vue';
import EquipmentModify from '@/views/Home/Equipment/components/equipment/equipmentModify.vue';
import EquipmentTransfer from '@/views/Home/Equipment/components/equipment/equipmentTransferFormList.vue';
import EquipmentTransferDetail from '@/views/Home/Equipment/components/equipment/equipmentTransferDetail.vue';
import SaveOneEquipment from '@/views/Home/Equipment/components/equipment/equipmentSaveOne.vue';
import Manage from '@/views/Home/Manage/index.vue';
import saveOneEquipmentTransfer from "@/views/Home/Equipment/components/equipment/saveOneEquipmentTransfer.vue";
import modifyEquipmentTransfer from '@/views/Home/Equipment/components/equipment/modifyEquipmentTransfer.vue'
import MaterialList from "@/views/Home/Material/components/materialList.vue";
import MaterialDetail from "@/views/Home/Material/components/materialDetail.vue";
import MaterialInSaveOne from "@/views/Home/Material/components/materialInSaveOne.vue";
import MaterialOutSaveOne from "@/views/Home/Material/components/materialOutSaveOne.vue";
import MaterialInList from "@/views/Home/Material/components/materialInList.vue";
import MaterialOutList from "@/views/Home/Material/components/materialOutList.vue";
import MaterialInDetail from "@/views/Home/Material/components/materialInDetail.vue";
import MaterialOutDetail from "@/views/Home/Material/components/materialOutDetail.vue";
import MaterialModify from "@/views/Home/Material/components/materialModify.vue";
import MaterialInModify from "@/views/Home/Material/components/materialInModify.vue";
import MaterialOutModify from "@/views/Home/Material/components/materialOutModify.vue";
import newMaterialSaveOne from "@/views/Home/Material/components/newMaterialSaveOne.vue";
import Test1 from "@/views/Test/test1.vue"
import EquipmentManager from "@/views/Home/Manage/components/EquipmentManager.vue";
import UserManager from "@/views/Home/Manage/UserManager/index.vue";
import UserList from "@/views/Home/Manage/UserManager/components/UserList.vue";
import UserDetail from '@/views/Home/Manage/UserManager/UserDetail/index.vue';
import UserUpdate from '@/views/Home/Manage/UserManager/UserUpdate/index.vue';
import AddUser from '@/views/Home/Manage/UserManager/AddUser/index.vue';
import ProjectManager from "@/views/Home/Manage/ProjectInfoManage/index.vue";
import ProjectList from "@/views/Home/Manage/ProjectInfoManage/components/ProjectList.vue";
import ProjectDetail from "@/views/Home/Manage/ProjectInfoManage/ProjectDetail/index.vue";
import ProjectUpdate from "@/views/Home/Manage/ProjectInfoManage/ProjectUpdate/index.vue";
import AddProject from "@/views/Home/Manage/ProjectInfoManage/AddProject/index.vue";
import WarehouseLayoutManager from "@/views/Home/Manage/WarehouseLayoutManage/index.vue";
import WarehouseLayoutDetail from "@/views/Home/Manage/WarehouseLayoutManage/WarehouseLayoutDetail/index.vue";
import WarehouseLayoutUpdate from "@/views/Home/Manage/WarehouseLayoutManage/WarehouseLayoutUpdate/index.vue";
import WarehouseLayoutList from "@/views/Home/Manage/WarehouseLayoutManage/components/WarehouseLayoutList.vue";
import AddWarehouseLayout from "@/views/Home/Manage/WarehouseLayoutManage/AddWarehouseLayout/index.vue";
import WarehouseInfoManager from '@/views/Home/Manage/WarehouseInfoManage/index.vue'
import WarehouseList from '@/views/Home/Manage/WarehouseInfoManage/components/WarehouseList.vue';
import WarehouseDetail from '@/views/Home/Manage/WarehouseInfoManage/WarehouseDetail/index.vue';
import WarehouseUpdate from '@/views/Home/Manage/WarehouseInfoManage/WarehouseUpdate/index.vue';
import AddWarehouse from '@/views/Home/Manage/WarehouseInfoManage/AddWarehouse/index.vue';
import LocationList from "@/views/Home/Manage/Location/components/LocationList.vue";
import LocationManager from "@/views/Home/Manage/Location/index.vue";
import LocationDetail from "@/views/Home/Manage/Location/LocationDetail/index.vue";
import LocationUpdate from "@/views/Home/Manage/Location/LocationUpdate/index.vue";
import AddLocation from "@/views/Home/Manage/Location/AddLocation/index.vue";
import EquipTypeList from "@/views/Home/Manage/EquipTypeManage/compoents/EquipTypeList.vue";
import EquipTypeManager from "@/views/Home/Manage/EquipTypeManage/index.vue"
import EquipTypeDetail from "@/views/Home/Manage/EquipTypeManage/EquipTypeDetail/index.vue";
import EquipTypeUpdate from "@/views/Home/Manage/EquipTypeManage/EquipTypeUpdate/index.vue";
import AddEquipType from "@/views/Home/Manage/EquipTypeManage/AddEquipType/index.vue";
import MaterialTypeList from "@/views/Home/Manage/MaterialTypeManage/components/MaterialTypeList.vue";
import MaterialTypeManager from "@/views/Home/Manage/MaterialTypeManage/index.vue"
import MaterialTypeDetail from "@/views/Home/Manage/MaterialTypeManage/MaterialTypeDetail/index.vue";
import MaterialTypeUpdate from "@/views/Home/Manage/MaterialTypeManage/MaterialTypeUpdate/index.vue";
import AddMaterialType from "@/views/Home/Manage/MaterialTypeManage/AddMaterialType/index.vue";
import MaterialStockTake from "@/views/Home/Manage/StockTakeManage/index.vue";
import UserInfo from "@/views/Home/UserInfo/index.vue";
import WarehouseLayoutManage from "@/views/Home/Material/components/warehouseLayoutManage.vue";
import MaterialTypeManage from "@/views/Home/Material/components/materialTypeManage.vue";
import addEquipType from "@/views/Home/Equipment/components/equipment/addEquipType.vue";
import MaterialAnalyse from "@/views/Home/Material/components/materialAnalyse.vue";


const router=createRouter({
    history:createWebHistory(import.meta.env.BASE_URL),
    routes:[
        {
            path:'/login',
            component:Login,
        },
        {
            path:'/',
            component:Layout,
            children:[
                {
                    path:'',
                    component:FirstMenu,
                },
                {
                    path:'/home',
                    component:Home,
                    children:[
                        {
                            path:'/home/material',
                            component:Material,
                            children:[
                                // 材料列表
                                {
                                    path:'',
                                    component:MaterialList
                                },
                                // 单项材料详情
                                {
                                    path: '/home/material/materialDetail/:id',
                                    component:MaterialDetail
                                },
                                // 新添加一项材料进场数据（材料已经在库内，只是添加数量）
                                {
                                    path: '/home/material/materialInSaveOne/:id',
                                    component:MaterialInSaveOne
                                },
                                // 新添加一条材料进场信息（该材料原先库内没有）
                                {
                                    path: '/home/material/newMaterialSaveOne',
                                    component:newMaterialSaveOne
                                },
                                // 新添加一条材料出场信息（已在库内，只是减少库内数量）
                                {
                                    path: '/home/material/materialOutSaveOne/:id',
                                    component:MaterialOutSaveOne
                                },
                                // 材料进场表单列表
                                {
                                    path: '/home/material/materialInList',
                                    component:MaterialInList
                                },
                                // 材料出场表单列表
                                {
                                    path: '/home/material/materialOutList',
                                    component:MaterialOutList
                                },
                                // 一项材料进场表单详情
                                {
                                    path: '/home/material/materialInDetail/:id',
                                    component:MaterialInDetail
                                },
                                // 一项材料出场表单详情
                                {
                                    path: '/home/material/materialOutDetail/:id',
                                    component:MaterialOutDetail
                                },
                                // 修改一条材料表单信息
                                {
                                    path: `/home/material/materialModify/:id`,
                                    component:MaterialModify
                                },
                                // 修改一条材料进场表单信息
                                {
                                    path: `/home/material/materialInModify/:id`,
                                    component:MaterialInModify
                                },
                                // 修改一条材料出场表单信息
                                {
                                    path: `/home/material/materialOutModify/:id`,
                                    component:MaterialOutModify
                                },
                                {
                                    path:'/home/material/warehouseLayoutManage',
                                    component:WarehouseLayoutManage,
                                },
                                {
                                    path:'/home/material/materialTypeManage',
                                    component:MaterialTypeManage,
                                },

                                // 统计数据用
                                {
                                    path:'/home/material/analyse/:id',
                                    component:MaterialAnalyse,
                                },

                            ]

                        },
                        {
                            path:'/home/equipment',
                            component:Equipment,
                            children:[
                                {
                                    path:'',
                                    component:EquipmentList
                                },
                                {
                                    path:'/home/equipment/equipmentDetail/:id',
                                    component:EquipmentDetail
                                }
                                ,{
                                    path:'/home/equipment/modifyOne',
                                    component:EquipmentModify
                                },
                                {
                                    path:'/home/equipment/equipmentTransfer/',
                                    component:EquipmentTransfer
                                },
                                {
                                    path:'/home/equipment/equipmentTransferDetail/:id',
                                    component:EquipmentTransferDetail
                                }
                                ,
                                {
                                    path:'/home/equipment/saveOneEquipment',
                                    component:SaveOneEquipment
                                }
                                ,
                                {
                                    path:'/home/equipment/saveOneEquipmentTransfer/:id',
                                    component:saveOneEquipmentTransfer
                                }
                                ,
                                {
                                    path:'/equip-transfer/modifyOne/:id',
                                    component:modifyEquipmentTransfer
                                },
                                {
                                    path:'/home/equipment/addEquipType',
                                    component:addEquipType
                                }
                            ]
                        },
                        {
                            path:'/manage',
                            component:Manage,
                            children:[
                                {
                                    //     MaterialManager为默认页
                                    path: ``,
                                    component: UserManager,
                                    children:[
                                        {
                                            path:'',
                                            component:UserList
                                        },
                                    ]
                                },
                                {
                                    path: `/manage/equipmentManager`,
                                    component: EquipmentManager
                                },
                                {
                                    path: `/manage/userManager`,
                                    component: UserManager,
                                    children:[
                                        {
                                            path:'',
                                            component:UserList
                                        },
                                        {
                                            path:`/manage/userDetail/:id`,
                                            component:UserDetail
                                        },
                                        {
                                            path:`/manage/userUpdate/:id`,
                                            component:UserUpdate
                                        },
                                        {
                                            path:`/manage/addUser`,
                                            component:AddUser
                                        },
                                    ]
                                },
                                {
                                    path: `/manage/projectManager`,
                                    component: ProjectManager,
                                    children:[
                                        {
                                            path:'',
                                            component:ProjectList
                                        },
                                        {
                                            path:`/manage/projectDetail/:id`,
                                            component:ProjectDetail
                                        },
                                        {
                                            path:`/manage/projectUpdate/:id`,
                                            component:ProjectUpdate
                                        },
                                        {
                                            path:`/manage/addProject`,
                                            component:AddProject
                                        },
                                    ]
                                },
                                {
                                    path:`/manage/warehouseLayoutManager`,
                                    component:WarehouseLayoutManager,
                                    children:[
                                        {
                                            path:'',
                                            component:WarehouseLayoutList
                                        },
                                        {
                                            path:`/manage/warehouseLayoutDetail/:id`,
                                            component:WarehouseLayoutDetail
                                        },
                                        {
                                            path:`/manage/warehouseLayoutUpdate/:id`,
                                            component:WarehouseLayoutUpdate
                                        },
                                        {
                                            path:`/manage/addWarehouseLayout`,
                                            component:AddWarehouseLayout
                                        },
                                    ]
                                },
                                {
                                    path:`/manage/warehouseManager`,
                                    component:WarehouseInfoManager,
                                    children:[
                                        {
                                            path:'',
                                            component:WarehouseList
                                        },
                                        {
                                            path:`/manage/warehouseDetail/:id`,
                                            component:WarehouseDetail
                                        },
                                        {
                                            path:`/manage/warehouseUpdate/:id`,
                                            component:WarehouseUpdate
                                        },{
                                            path:`/manage/addWarehouse`,
                                            component:AddWarehouse
                                        }
                                    ]
                                },
                                {
                                    path:`/manage/locationManager`,
                                    component:LocationManager,
                                    children:[
                                        {
                                            path:'',
                                            component:LocationList
                                        },
                                        {
                                            path:`/manage/locationDetail/:id`,
                                            component:LocationDetail
                                        },
                                        {
                                            path:`/manage/locationUpdate/:id`,
                                            component:LocationUpdate
                                        },{
                                            path:`/manage/addLocation`,
                                            component:AddLocation
                                        }
                                    ]
                                },
                                // 设备类型管理
                                {
                                    path:`/manage/equipTypeManager`,
                                    component:EquipTypeManager,
                                    children:[
                                        {
                                            path:'',
                                            component:EquipTypeList
                                        },
                                        {
                                            path:`/manage/equipTypeDetail/:id`,
                                            component:EquipTypeDetail
                                        },
                                        {
                                            path:`/manage/equipTypeUpdate/:id`,
                                            component:EquipTypeUpdate
                                        },{
                                            path:`/manage/addEquipType`,
                                            component:AddEquipType
                                        }
                                    ]
                                },
                            //     材料类型管理
                                {
                                    path:`/manage/materialTypeManager`,
                                    component:MaterialTypeManager,
                                    children:[
                                        {
                                            path:'',
                                            component:MaterialTypeList
                                        },
                                        {
                                            path:`/manage/materialTypeDetail/:id`,
                                            component:MaterialTypeDetail
                                        },
                                        {
                                            path:`/manage/materialTypeUpdate/:id`,
                                            component:MaterialTypeUpdate
                                        },{
                                            path:`/manage/addMaterialType`,
                                            component:AddMaterialType
                                        }
                                    ]
                                },
                            //     盘点操作
                                {
                                    path: `/manage/materialStockTake`,
                                    component: MaterialStockTake,
                                }
                            ]
                        },
                    ]
                },
                {
                    path:'/userInfo',
                    component:UserInfo,
                },
                {
                    path:'/test1',
                    component:Test1
                }
            ]
        },


    ]
})

export default router